package com.boruiimage.demo.utils;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.boruiimage.demo.doMain.Result;
import com.google.gson.reflect.TypeToken;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import org.junit.Test;
import org.omg.Messaging.SYNC_WITH_TRANSPORT;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class testS {
    @Test
    public void show(){
        Map map=new HashMap();
       // Result result = new Result("1", 2, null, "ss", "5", "6","");
       // String json_string = JsonUtils.serialize(result);
       /* Map maps=new HashMap();
        maps.put("userName","张三");
        maps.put("productId","0");
        maps.put("imageName","ss.jpg");
        maps.put("imageresult","ssss");*/
        //map.put("ache",json_string);
        System.out.println(map.get("ache"));



        //System.out.println("json -> " + json_string);

        Result result12 = JsonUtils.deserialize(map.get("ache").toString(), new TypeToken<Result>(){}.getType());
        System.out.println("result12 -> " + result12.getImgName());

       /* List list = new ArrayList();
        list.add(result);
        String serialize = JsonUtils.serialize(list);
        List<Result> resultList = JsonUtils.deserialize(serialize, new TypeToken<List<Result>>(){}.getType());
        System.out.println("resultList -> " + resultList);*/
    }

       }


